//
//  ViewController.m
//  FoodHub
//
//  Created by 周杨 on 14/11/4.
//  Copyright (c) 2014年 zhouy. All rights reserved.
//

#import "ViewController.h"
#import "ActionController.h"
#import "UIColor+HexString.h"

#import "SelAction.h"
#import "DoubleBallDrawing.h"
#import "DoubleColorBall.h"
#import "DoubleTicket.h"
#import "DoubleBallDrawing+BlueValidation.h"
#import "DoubleBallDrawing+SumValidation.h"
#import "DoubleBallDrawing+Validation.h"


@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    
    [self.view setBackgroundColor:[UIColor blackColor]];
    
//    UILabel * txtTil=[[UILabel alloc] initWithFrame:CGRectMake(0, 20, [self.view bounds].size.width, 160) ];
//    txtTil.text = @"你们好！   ";
//    txtTil.textColor = [UIColor whiteColor];
//    txtTil.textAlignment = NSTextAlignmentRight;
    
    UITextField * txtIn = [[UITextField alloc] init];
    txtIn.frame =CGRectMake(0, 20, [self.view bounds].size.width, 160);
    txtIn.text = @"你们好！   ";
    txtIn.textColor = [UIColor whiteColor];
    txtIn.textAlignment = NSTextAlignmentRight;
    
    
    UIButton * btn = [UIFactory CreateUIButton:@"生成彩票"];
    btn.frame = CGRectMake(40,180,100,30);
    
    [btn addTarget:self action:@selector(btnAction:) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:txtIn];
    [self.view addSubview:btn];
}

-(void) btnAction:(id) sender{
    DoubleBallDrawing * ballDraw = [[DoubleBallDrawing alloc] init];
    
    NSMutableArray * actionList = [[NSMutableArray alloc] init];
    
    [actionList addObject:[[SelAction alloc] init:@"历史球验证" andSel:@selector(isHistory:)]];
    [actionList addObject:[[SelAction alloc] init:@"和值数验证" andSel:@selector(SumValidation:)]];
    [actionList addObject:[[SelAction alloc] init:@"篮球验证" andSel:@selector(isHistory:)]];
    
    [ballDraw drawingStrat:actionList];
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

@end
